package okl.tdf.app.model
{
	import okl.tdf.app.controller.messages.FeedControlMessage;
	import okl.tdf.app.services.ITdfFeedService;

	/**
	 *	@author "oleksandr.kulinchenko@gmail.com"
	 */
	public class FeedControlModel
	{
		public function FeedControlModel()
		{
		}
		[Inject]
		public var service:ITdfFeedService;
		
		[Inject][Bindable]
		public var appModel:AppModel;
		
		//messages	
		[MessageDispatcher]public var sendMessage:Function;
		public function controlFeed():void{
			if(appModel.feedState==AppModel.STATE_INACTIVE){
				service.startViewsFeed();
			}else{
				service.stopViewsFeed();
			}
			appModel.feedState=AppModel.STATE_WAITING;	
			
					
		}
	}
}